package v2

type GraphType uint8

const (
	// directed graph
	Directed GraphType = iota
	// undirected graph
	UnDirected
)

type Graph interface {
	// 返回图的类型
	GetType() GraphType
	// 返回顶点数
	GetVertexNum() int
	// 返回边数
	GetEdgeNum() int
	// 返回顶点
	GetVertex() chan Vertex
	// 返回所有的边
	GetEdge() Iterator
	RemoveVertex(vertex Vertex)
	RemoveEdge(edge Edge)
	InsertVertex(vertex Vertex) Node
	InsertEdge(edge Edge) Node
	AreAdjacent(u Vertex, v Vertex) bool
	EdgeFromTo(u Vertex, v Vertex) Edge
	AdjVertex(vertex Vertex) Iterator
	DFSTraverse(vertex Vertex) Iterator
	BFSTraverse(vertex Vertex) Iterator
	ShortestPath(vertex Vertex) Iterator
	GenerateMSG() error
	TopologicalSort() (Iterator, error)
	CriticalPath() error
	AddWeightEdge(from Vertex, to Vertex, weight int)
	Vertices() []Vertex
}
